<?php

namespace catchAdmin\pc\tables;

use catchAdmin\pc\tables\forms\Factory;
use catcher\CatchTable;
use catcher\library\table\Actions;
use catcher\library\table\HeaderItem;
use catcher\library\table\Search;

class WithdrawIncome extends CatchTable
{

    public function Table()
    {
        return $this->getTable('withdrawIncome')
            ->header([
                HeaderItem::label('公司名')->prop('wechat_user_company_name'),
                HeaderItem::label('申请提现金额')->prop('num'),
//                HeaderItem::label('类型')->prop('balance_type_2_name'),
                HeaderItem::label('申请提现时间')->prop('created_at'),
                HeaderItem::label('审核备注')->prop('balance_status_note'),
                HeaderItem::label('审核状态')->prop('balance_status_name'),
                HeaderItem::label('审核时间')->prop('balance_status_time_show'),
                HeaderItem::label('操作')
                    ->actions([
//                        Actions::update(),
                    Actions::normal('通过审核','zz2','tgsh'),
                        Actions::view(),

                    ])
                    ->width(220),
            ])
            ->withSearch([
                Search::label('公司名')->text('wechat_user_company_name', '公司名')->style(['width' => '150px'])
                    ->clearable(true),
                Search::label('审核状态')
                    ->radio('balance_status', tableSelectArray((new \catchAdmin\model\WechatUserBalance())->getBalanceStatusNameList()))
                    ->style(['width' => '300px'])
//                    ->clearable(true),
            ])
            ->selectionChange()
            ->withApiRoute('withdrawIncome')
            ->withActions([
//                Actions::create(),
//                Actions::export(),
            ])
            ->render();
    }


    public function form()
    {
        return Factory::create('withdrawIncome');
    }

}
